<script setup>
import { onMounted, ref } from 'vue'

const myInpRef = ref(null)

onMounted(() => {
  // myInpRef.value.focus()
})

const btnRef = ref(null)
console.log(btnRef.value)

onMounted(() => {
  console.log(btnRef.value)
})

const clickMe = () => {
  myInpRef.value.focus()
}
</script>

<template>
  <div>
    <input ref="myInpRef" type="text" />
    <button ref="btnRef" @click="clickMe">点我</button>
  </div>
</template>

<style scoped></style>
